package com.lanxin.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 分页数据
 * @author cyh
 * @create 2025-09-17 11:51
 */
@Data
@ApiModel(value = "分页数据")
public class PageVO<T>  implements Serializable {

    @ApiModelProperty(value = "页码",dataType = "long")
    private long current;

    @ApiModelProperty(value = "页面记录数",dataType = "long")
    private long pages;

    @ApiModelProperty(value = "总页数",dataType = "long")
    private long size;

    @ApiModelProperty(value = "总记录数",dataType = "long")
    private long total;

    @ApiModelProperty(value = "分页记录",dataType = "List")
    private List<T> records;

    public PageVO(IPage<T> page) {
        this.current = page.getCurrent();
        this.size = page.getSize();
        this.total = page.getTotal();
        this.pages = page.getPages();
        this.records = page.getRecords();
    }






}
